import React, { FC } from "react"
import { House } from "lucide-react"
import { NodeProps, Position } from "@xyflow/react"
import { CustomNode } from "../type"
import CustomHandle from "@/components/workflow/handles/custom-handle/handle"

type Props = NodeProps<CustomNode>

/**
 * 开始节点
 */
const Start: FC<Props> = (props) => {
  const { id, data } = props

  return (
    <div className="flex items-center">
      <div className="flex items-center justify-center w-8 h-8 bg-blue-600 rounded-xl">
        <House className="w-4 h-4 text-white" />
      </div>
      <div className="ml-2 text-sm text-gray-800 font-semibold">开始</div>

      <div>
        <CustomHandle id={`${id}-source-${data.type}`} type="source" position={Position.Right} />
      </div>
    </div>
  )
}

export default Start
